package com.effectiv.gooruda.domain;

import java.io.Serializable;



import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Email;
import org.joda.time.DateTime;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@ToString
@Document(collection="t_tenant_user")
@EqualsAndHashCode(exclude={"email","name","password","createdDate","lastUpdatedDate","tenantCompany","role", "active"})
public class TenantCompanyUser implements Serializable{
	
	
	private static final long serialVersionUID = 1L;

	@Getter @Setter
	@Id
	private String id;
	
	@Indexed(unique=true)
	@Email
	@Getter @Setter
	private String email;
	
	@NotNull
	@Getter @Setter
	private String name;
	
	@Getter @Setter
	private String password;
	
	@CreatedDate
	@Getter @Setter
	private DateTime createdDate;
	
	@LastModifiedDate
	@Getter @Setter
	private DateTime lastUpdatedDate;
	
	@Getter @Setter
	@DBRef
	private TenantCompany tenantCompany;
	
	@Getter @Setter
	@DBRef
	private Lov role;
	
	@Getter @Setter
	private boolean active;
	
}
